#include <utils.h>
#define IRINGBUF_LENGTH 20

char buf[IRINGBUF_LENGTH][128];
size_t cur = 0;

void print_iringbuf() {
  for(size_t i = 0; i < IRINGBUF_LENGTH; i++) {
    printf("%s%s\n", i == cur ? "-->\t" : "\t", buf[i]);
  }
}

void write_iringbuf(const char *s) {
  cur = (cur + 1) % IRINGBUF_LENGTH;
  snprintf(buf[cur], 128, "%s", s);
}